﻿using Module.Common.Common;
using Module.Common.PubEvent;
using DryIoc;
using Prism.Commands;
using Prism.Events;
using Prism.Ioc;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Media.Effects;

namespace Module.FreePlay.ViewModels
{
    /// <summary>
    /// 棋盘类的ViewModel
    /// </summary>
    public class FreePlayAppViewModel : BindableBase
    {
        private readonly IEventAggregator Ea;
        public DelegateCommand BackStepCommand { get; private set; }

        public FreePlayAppViewModel(IEventAggregator ea)
        {
            this.Ea = ea;
            BackStepCommand = new DelegateCommand(OnBackStep);
        }

        private void OnBackStep()
        {
            Ea.GetEvent<ModuleMessageEvent>().Publish(new ModuleMessage()
            {
                MessageName = "goBackStep",
                SenderFrom = this.GetType().Name,
                Content = $"【{this.GetType().Name}】：用户点击了悔棋（上一步）按钮",
                ModuleName = this.GetType().Module.Name
            });
        }
    }
}
